#ifndef _DEV_MOTOR_H
#define _DEV_MOTOR_H

#include "device_conf.h"

// 注意！！！
// PWM端口需要根据相应的芯片手册配置，端口更改需要在源文件中更改

// 电机PWM定时器选择
#ifdef STM32F10X
#include "stm32f10x.h"

//#define STM32_MOTOR_PWM_TIM1  
//#define STM32_MOTOR_PWM_TIM2
#define STM32_MOTOR_PWM_TIM3
//#define STM32_MOTOR_PWM_TIM4

#endif

// PWM输出功能选择
//#define COMPLEMENTARY_PWM   // 互补PWM输出

void motor_pwm_init(uint16 period, uint16 frequency); // 电机PWM初始化函数；period: 计数周期；frequency：PWM频率
void motor_pwm_output_4ch(uint16 compare1, uint16 compare2, uint16 compare3, uint16 compare4); // 4路PWM输出

#endif
